package Java.j2;

import java.util.Scanner;

public class AcWing_667 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int duration;

        if (a == b) {
            duration = 24;
        } else if (a < b) {
            duration = b - a;
        } else {
            duration = 24 - a + b;
        }

        System.out.printf("O JOGO DUROU %d HORA(S)", duration);

    }
}
